#include "employee.h"

int Employee::nextId = 1;

Employee::Employee() : id(nextId++), age(0), salary(0.0) {}

Employee::Employee(const QString &name, int age, const QString &department,
                   const QString &position, double salary)
    : id(nextId++), name(name), age(age), department(department),
      position(position), salary(salary) {}

// Getter实现
QString Employee::getName() const { return name; }
int Employee::getAge() const { return age; }
QString Employee::getDepartment() const { return department; }
QString Employee::getPosition() const { return position; }
double Employee::getSalary() const { return salary; }
int Employee::getId() const { return id; }

// Setter实现
void Employee::setName(const QString &name) { this->name = name; }
void Employee::setAge(int age) { this->age = age; }
void Employee::setDepartment(const QString &department) { this->department = department; }
void Employee::setPosition(const QString &position) { this->position = position; }
void Employee::setSalary(double salary) { this->salary = salary; }
